import { DatePicker, Select } from "antd";
const { RangePicker } = DatePicker;
import dayjs from "dayjs";


export const useConfig = (props) => {
  const today = dayjs(); //今天
  const tommorrow = dayjs().add(1, "day"); //明天
  const timeLong = 30 //预约时间
  let arr = [
    {
      label: "房间类型",
      name: "roomType",
      children: (
        <Select
          fieldNames={{
            label: "value",
            value: "key",
          }}
          placeholder="请选择"
          style={{ width: 300 }}
        />
      ),
    },
    {
      label: "入住时间-退房时间",
      name: "time",
      initialValue:[tommorrow,tommorrow.add(timeLong,'day')],
      children: <RangePicker allowClear={false} disabledDate={(d) => d.isBefore(today)||d.isAfter(today.add(timeLong,'day'))} />,
    },
  ];

  return arr;
};
